package com.shrct.businessprocess.purchase;

import com.shrct.businessprocess.budget.RCBudget;
import com.shrct.businessprocess.diagnose.IDiagnoseAcceptor;
import com.shrct.businessprocess.organization.RCSupplier;
import com.shrct.businessprocess.product.RCIdentifiablePhysicalProductEntry;
import com.shrct.businessprocess.product.RCProductEntry;
import com.shrct.businessprocess.product.RCProductSpecification;
import com.shrct.businessprocess.product.RCServiceLevel;
import com.shrct.businessprocess.product.RCServiceResponseTime;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.purchase.ICanAcceptProductService;
import com.shrct.businessprocess.purchase.IHasAcceptedProducts;
import com.shrct.businessprocess.purchase.RCBasePurchaseOrder;
import com.shrct.businessprocess.purchase.RCProductPurchaseRequest;
import com.shrct.businessprocess.purchase.RCPurchaseOrderAccept;
import com.shrct.businessprocess.purchase.RCPurchaseOrderItem;
import com.shrct.businessprocess.purchase.RCPurchaseOrderStatus;
import com.shrct.businessprocess.purchase.impl.RCPurchaseOrderImpl;
import com.shrct.businessprocess.purchase.proxy.RCPurchaseOrderProxy;
import edu.fudan.mylang.pf.EntityImplementation;
import java.util.Collection;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@EntityImplementation(implementBy = RCPurchaseOrderImpl.class)
public interface RCPurchaseOrder extends RCBasePurchaseOrder, IHasAcceptedProducts, ICanAcceptProductService {
  public abstract RCProductPurchaseRequest getPurchaseRequest();
  
  public abstract RCPurchaseOrder setPurchaseRequest(final RCProductPurchaseRequest purchaseRequest);
  
  public abstract Collection<RCPurchaseOrderItem> getOrderItems();
  
  public abstract RCPurchaseOrderItem createAndAddtoOrderItems();
  
  public abstract RCPurchaseOrderItem createAndAddtoOrderItems(final Procedure1<RCPurchaseOrderItem> updater);
  
  public abstract RCPurchaseOrder removeFromOrderItems(final RCPurchaseOrderItem rCPurchaseOrderItem);
  
  public abstract RCPurchaseOrder removeAllOrderItems();
  
  public abstract Collection<RCPurchaseOrderAccept> getAcceptItems();
  
  public abstract RCPurchaseOrderAccept createAndAddtoAcceptItems();
  
  public abstract RCPurchaseOrderAccept createAndAddtoAcceptItems(final Procedure1<RCPurchaseOrderAccept> updater);
  
  public abstract RCPurchaseOrder removeFromAcceptItems(final RCPurchaseOrderAccept rCPurchaseOrderAccept);
  
  public abstract RCPurchaseOrder removeAllAcceptItems();
  
  public abstract RCBudget getBudget();
  
  public abstract RCPurchaseOrderAccept createAcceptItem();
  
  public abstract Integer getTotalOrderItemsQuantity();
  
  public abstract Integer getTotalAcceptItemsQuantity();
  
  public abstract Integer getTotalAcceptItemsQuantity(final RCProductSpecification productSpec);
  
  /**
   * 收货总金额
   */
  public abstract RCProjectMoney getTotalAcceptItemsAmount();
  
  /**
   * 订单总金额
   */
  public abstract RCProjectMoney getTotalCost();
  
  /**
   * 所有订单项目都已经到货，所有的钱都已经支付
   */
  public abstract Boolean getIsFinished();
  
  public abstract Boolean getIsAllItemsAccepted();
  
  public abstract Iterable<RCProductEntry> getAllAcceptedProducts();
  
  public abstract void acceptProductService(final String name, final String serviceSpec, final String serviceContractCode, final RCSupplier productSupplier, final RCIdentifiablePhysicalProductEntry product, final RCServiceLevel serviceLevel, final RCServiceResponseTime serviceResponseTime, final Date startDate, final Date dueDate, final RCProjectMoney price, final Boolean isPartDevice);
  
  public abstract void diagnose(final IDiagnoseAcceptor acceptor);
  
  public abstract RCPurchaseOrderStatus getStatus();
  
  public abstract void start();
  
  public abstract void startAudit();
  
  public abstract void auditPassed();
  
  public abstract void auditCanceled();
  
  public abstract void acceptItem();
  
  public abstract void invoiceRegister();
  
  public abstract void payRequest();
  
  public abstract void close();
  
  public abstract void postCancel();
  
  public abstract void cancelClose();
  
  public abstract Boolean isCraeted();
  
  public abstract Boolean isAuditing();
  
  public abstract Boolean isExecuting();
  
  public abstract Boolean isClosed();
  
  public abstract Boolean isCanceled();
  
  public abstract RCPurchaseOrderProxy toProxy();
}
